#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @File  : 3.对bug定位的代码进行优化.py
# @Author: Micah
# @Func  : 用于
# @Time  : 2023/11/14


def debug():
    import inspect
    caller_name = inspect.stack()[1][3]   # 可以返回函数名和当前函数的返回值
    print("[DEBUG]: enter {}()".format(caller_name))


def say_hello():
    debug()
    print('hello!')


def say_goodbye():
    debug()
    print('goodbye!')


if __name__ == '__main__':
    say_hello()
    say_goodbye()
